<template>
    <div>
        <h3>子组件</h3>
        <button @click="sendFn">触发事件</button>
        <button @click="$parent.getDates('这是传递的数据')">触发事件2</button>
    </div>
</template>
<script setup>
import { defineEmits, inject } from 'vue';
const emit = defineEmits(['getDate']);
console.log(emit);
function sendFn() {
    // emit('getDate', new Date());
    console.log(ZuDates);
}
const ZuDates = inject('ZuDates');
</script>